package com.example.demo.dao;

import com.example.demo.entity.Video;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface VideoDAO {
    List<Video> findAllVideo();

    List<Video> listVideoBySearchMsg(@Param("searchMsg") String searchMsg,@Param("start") int start);
    int listVideoBySearchMsgTotal(@Param("searchMsg") String searchMsg);
    @Delete("delete from video where id = #{id}")
    void deleteVideoById(int id);

    @Update("update video set title = #{title},address=#{address},time=#{time} where id=#{id}")
    void editVideo(Video video);

    @Insert("insert into video (title,address,time) values(#{title},#{address},#{time})")
    void addVideo(Video video);
}
